package com.rsglxt.server;

import java.util.List;

import com.entity.Zd;
import com.entity.ZdDAO;

public class ZdServer {
  
	ZdDAO dao;

	public ZdDAO getDao() {
		return dao;
	}

	public void setDao(ZdDAO dao) {
		this.dao = dao;
	}
	/**
	 * 得到全部内容
	 * @return
	 */
	public List getall()
	{
		return dao.findAll();
	}
	/**
	 * 根据id查找相应的信息
	 */
	public Zd getzd(Integer id)
	{
		return dao.findById(id);
	}
	

	public List gettypenames()
	{
		return dao.gettypenames();
	}
	public List gettypename()
	{
		return dao.gettypename();
	}
	
	public Zd getZd(String typename)
	{
		return (Zd)dao.findByTypename(typename).get(0);
	}
	public void savazd(Zd zd)
	{
		dao.save(zd);
	}
	public Zd getzdparentid(Integer parentid)
	{
		return dao.findById(parentid);
	}
	
	public Zd gettypenames(String typenames)
	{
		return (Zd)dao.findByTypenames(typenames).get(0);
	}
	
	public void saveedit(Zd zd)
    {
		dao.attachDirty(zd);
    }
	
	public List getzdbm()
	{
		return dao.getzdbm();
	}
	public List showlist(String hql)
    {
		return dao.getHibernateTemplate().find(hql);
	}
	public List getbm()
	{
		return dao.getHibernateTemplate().find("from Zd where typename like '乡%'");
	}
}

